package com.xuelang.pipeline.client.common.result;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import jakarta.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 分页结果bean
 *
 * @author xiwen.zxg
 * @since 2024/5/16
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class PageRecord<T> implements Serializable {

    private static final long serialVersionUID = 1L;
    /**
     * 当前页
     */
    @NotNull(message = "当前页不能为空")
    private Long currentPage;
    /**
     * 每页大小
     */
    @NotNull(message = "每页大小不能为空")
    private Long pageSize;
    /**
     * 总记录数
     */
    @NotNull(message = "总记录数不能为空")
    private Long totalCount;
    /**
     * 总页数
     */
    @NotNull(message = "总页数不能为空")
    private Long totalPages;
    /**
     * 数据列表
     */
    private List<T> records;

}
